//
//  uiview+Extesion.swift
//  MicroBlog
//
//  Created by 孙程 on 2017/7/15.
//  Copyright © 2017年 孙程. All rights reserved.
//

import UIKit
//对UIview的扩展
extension UIView{
    //扩展计算属性
    //X坐标
    var x:CGFloat{
        get{
            return frame.origin.x
        }set{
            frame.origin.x = newValue
        }
        
    }
    //Y坐标
    var y:CGFloat{
        get{
            return frame.origin.y
        }set{
            frame.origin.y = newValue
        }
        
    }
    //宽度
    var width:CGFloat{
        get{
            return frame.size.width
        }set{
            frame.size.width = newValue
        }
    }
    //高度
    var height:CGFloat{
        get{
            return frame.size.height
        }set{
            frame.size.height = newValue
        }
    }
    //中心X
    var centerX:CGFloat{
        get{
            return center.x
        }set{
            center.x = newValue
        }
    }
    //中心Y
    var centerY:CGFloat{
        get{
            return center.y
        }set{
            center.y = newValue
        }
    }
    //size大小
    var size:CGSize{
        get{
            return frame.size
        }set{
            frame.size = newValue
        }
    }
    
    
    
    
    
}
